package com.dy.lock.screen.service.impl;

import java.util.Date;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.lock.screen.constants.Constant;
import com.dy.lock.screen.dao.CustomerReportDao;
import com.dy.lock.screen.pojo.CustomerReportInfo;
import com.dy.lock.screen.service.CustomerReportService;

@Service("customerReportService")
public class CustomerReportServiceImpl implements CustomerReportService {

	@Resource(name = "customerReportDao")
	private CustomerReportDao customerReportDao;

	@Override
	public CustomerReportInfo queryByPrimaryKey(String id) {
		return this.customerReportDao.queryByPrimaryKey(id);

	}

	@Override
	public CustomerReportInfo queryByRidAndBeRid(CustomerReportInfo reportInfo) {
		// TODO Auto-generated method stub
		return this.customerReportDao.queryByRidAndBeRid(reportInfo);
	}

	@Override
	public int save(CustomerReportInfo customerReportInfo) {
		customerReportInfo.setId(UUID.randomUUID().toString());
		customerReportInfo.setIsDelete(Constant.IS_NOT_DELETE);
		customerReportInfo.setReportTime(new Date());
		customerReportInfo.setStatus(Constant.NOT_DEAL);
		return this.customerReportDao.insert(customerReportInfo);
	}

}
